#pragma once
#include "vector3f.h"
#include "Material.h"
#include "RenderableObject.h"

class Sphere : public RenderableObject
{
public:
    Sphere(void);
    virtual ~Sphere(void);

    void Init(Vector3f vCenter, float fRadius, Material& mat)
    {
        m_fCenter = vCenter;
        m_fRadius = fRadius;
        m_mat = mat;
    }

    Vector3f GetCenter()
    {
        return m_fCenter;
    }

    float GetRadius()
    {
        return m_fRadius;
    }

    Material* GetMaterial()
    {
        return &m_mat;
    }

    // Must implement this methold.
    // @line:     the incident line.
    // @fDisance: Set the distance from intersect point from the source point of the light.
    // @return  : if intersect return true.
    virtual bool Intersect(Line* line, IntersectInfo *pInfo);

protected:
    Vector3f m_fCenter;
    float    m_fRadius;
    Material m_mat;
};
